import axios from "@/http/axios";
import type { AddClassConfig, ClassDataConfig } from "@/http/Api/type";

// 添加班级
export const addClassApi = (params: AddClassConfig) =>
  axios({
    url: "/exam/baiJieClass/add",
    method: "POST",
    params,
  });

// 查询未毕业班级信息
// 状态,1表示查询可加入班级,不填表示全部
export const classStatusDataApi = (status: number) =>
  axios({
    url: "/exam/baiJieClass/getAll",
    method: "POST",
    params: {
      status,
    },
  });

// 分页查询班级信息
export const classDataApi = (params: ClassDataConfig) =>
  axios({
    url: "/exam/baiJieClass/getAllByPage",
    method: "POST",
    params,
  });

// 删除班级
export const delClassApi = (id: number) =>
  axios({
    url: "/exam/baiJieClass/del",
    method: "POST",
    params: { id },
  });

// 根据id查询班级信息
export const getClassByIdApi = (id: number) =>
  axios({
    url: "/exam/baiJieClass/getById",
    method: "POST",
    params: { id },
  });

// 修改班级信息
export const modifyClassApi = (params: AddClassConfig) =>
  axios({
    url: "/exam/baiJieClass/modify",
    method: "POST",
    params,
  });
